#include <properties/PropertyContainer.h>
#include <system/assert.h>

namespace liba {
namespace properties {

AbstractDependencyProperty* PropertyContainer::FindProperty(const Atom& name) 
{
	Properties::const_iterator i = this->properties.find(name);
	if (i == this->properties.end())
		return 0;

	return i->second;
}

void PropertyContainer::RegisterProperty(const Atom& name, AbstractDependencyProperty* prop)
{
	std::pair<Properties::iterator, bool> insertResult =
		this->properties.insert(std::make_pair(name, prop));

	LIBA_ASSERT(insertResult.second);
}

} // namespace properties
} // namespace liba